<?php
    header("Content-Type:text/html;charset=utf-8");
    
    
    define("HOST", "127.0.0.1");
    define("USERNAME", "root");
    define("PASSWORD", "123456");
    define("DBNAME", "login");
    define("CHARSET", "utf8");
    
    $con=mysqli_connect(HOST, USERNAME, PASSWORD, DBNAME) or die("数据库连接失败，<span style='color:red;'>".mysqli_connect_error()."</span>");
    mysqli_set_charset($con, CHARSET) or die("字符集编码设置无效");
?>